<?php

namespace app\screen\controller;

use app\common\lib\Arr;
use app\common\lib\Show;
use think\response\Json;

class WorkType extends ApiBase
{
    //获取工种树
    public function getWorkType(){
        $workTypeBis = new \app\common\business\WorkType();
        try {
            $data = $workTypeBis->getAllTree();
            $data = $workTypeBis->filterNoChildList($data);
        } catch (\Exception $e) {
            return Show::error([], $e->getMessage(), $e->getCode());
        }
        return Show::success($data);
    }
}
